/*
 * ResourcedException.java
 *
 * Created on 4 de Dezembro de 2007, 9:41
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package utility;

import java.util.Locale;

/**
 *
 * @author rafaelbuck
 */
public class ResourcedException extends Exception
{

    /** Creates a new instance of ResourcedException */
    public ResourcedException(String tag)
    {
        resTag = tag;
    }

    /** Creates a new instance of ResourcedException */
    public ResourcedException(String tag, String args[])
    {
        resTag = tag;
        this.args = args;
    }

    public String getMessage()
    {
        return getMessage(null);
    }

    public String getMessage(Locale l)
    {
        if(args != null)
            return I18n.format(resTag, args, l);
        else
            return I18n.getString(resTag, l);
    }

    protected String resTag;
    protected String args[];
}